import React from 'react';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import Home from '../pages/Home';
import TopicDetail from '../pages/TopicDetail';
import PostDetail from '../pages/PostDetail';
import NewTopic from '../pages/NewTopic';
import NewPost from '../pages/NewPost';

const Router: React.FC = () => (
  <BrowserRouter>
    <Routes>
      <Route path="/" element={<Home />} />
      <Route path="/topics/:topicId" element={<TopicDetail />} />
      <Route path="/topics/:topicId/posts/:postId" element={<PostDetail />} />
      <Route path="/new-topic" element={<NewTopic />} />
      <Route path="/topics/:topicId/post" element={<NewPost />} />
    </Routes>
  </BrowserRouter>
);

export default Router;